package com.umer.pinban.datafenxi.adapter;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.common.ui.recycleview.adapter.RecyclerviewBasicAdapter;
import com.common.ui.recycleview.base.ViewHolder;
import com.common.ui.recycleview.listener.OptListener;
import com.umer.pinban.R;
import com.umer.pinban.bean.fenxi.ProjectAnalyzeListBean;
import java.util.List;

public class DataFenXiAdapterSix extends RecyclerviewBasicAdapter<ProjectAnalyzeListBean> {

    private OptListener optListener;

    public DataFenXiAdapterSix(Context context, List<ProjectAnalyzeListBean> datas, int layoutId,
                               OptListener optListener) {
        super(context, datas, layoutId);
        this.optListener = optListener;
    }

    @Override
    public void convert(ViewHolder holder, final ProjectAnalyzeListBean projectAnalyzeListBean, final int position) {

        LinearLayout linear_six = holder.getView(R.id.linear_six);
        TextView tv_six_name = holder.getView(R.id.tv_six_name);
        TextView tv_number = holder.getView(R.id.tv_number);
        TextView tv_number2 = holder.getView(R.id.tv_number2);
        TextView tv_number3 = holder.getView(R.id.tv_number3);
        TextView tv_number4 = holder.getView(R.id.tv_number4);

        tv_six_name.setText(projectAnalyzeListBean.getCommodityName());
        tv_number.setText(""+projectAnalyzeListBean.getCommodityCustomerNum());
        tv_number2.setText("(" + projectAnalyzeListBean.getCommodityCustomerPercent() + ")");
        tv_number3.setText("" + projectAnalyzeListBean.getTotalNum());
        //tv_number4.setText("(" + projectAnalyzeListBean.getTotalNumPercent() + ")");


        linear_six.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                optListener.onOptClick(v,position);
            }
        });
    }
}
